﻿#ifndef PUSHBUTTONSWITCHTEXT_H
#define PUSHBUTTONSWITCHTEXT_H

#include <QWidget>
#include "PushButton.h"
#include "ui_base_lib_global.h"
typedef struct tagSwitchButtonTextInfo
{
    int trueValue;
    int falseValue;

    bool isChecked;
}SwitchButtonTextInfo;
class UI_BASE_LIBSHARED_EXPORT PushButtonSwitchText : public PushButton
{
    Q_OBJECT
public:
    explicit PushButtonSwitchText(QWidget *parent = nullptr);
    void initStyleSheet(QString str);
static void initButton(PushButtonSwitchText* p , QString text , QString textOn,int x , int y , int w , int h , QString strOn, QString strOff, tagSwitchButtonTextInfo info);
   void setButtonText(QString str);

   int getValue();
   void setValue(uint8_t flag);
   int getAttributeID();

   void changeOn();
   void changeOff();

   bool m_flag;
   QString m_strOn;
   QString m_strOff;

   int m_trueValue;
   int m_falseValue;
   QString m_text;
   QString m_textOn;
signals:

   void evt_valueChanged();

public slots:
       void on_click();
};

#endif 
